/*******************************************************************************
Module  : Configuration-Datei fuer das Modul "SPI_MCP2510"
Extends : SPI
Version : 0.0
Date    : 24.06.2007
Author  : Guenther Pammer

Compilerswitches: keine
*******************************************************************************/

#ifndef  SPI_MCP2510_H
#define  SPI_MCP2510_H 1

#include "spi.h"

/** \name	SPI Kommandos */
#define  SPI_RESET       0xC0
#define  SPI_READ        0x03
#define  SPI_READ_RX     0x90           // nur mit MCP2515 verfuegbar
#define  SPI_WRITE       0x02
#define  SPI_WRITE_TX    0x40           // nur mit MCP2515 verfuegbar
#define  SPI_RTS         0x80
#define  SPI_READ_STATUS 0xA0
#define  SPI_RX_STATUS   0xB0           // nur mit MCP2515 verfuegbar
#define  SPI_BIT_MODIFY  0x05

void SPI_MCP2510_reset ( void ); // Reset des CAN-Controllers
void SPI_MCP2510_sync  ( void ); // Synchronisation mit CAN-Controller

// Register des CAN-Controllers lesen
unsigned char SPI_MCP2510_reg_read  ( unsigned char addr );

// Register des CAN-Controllers schreiben
void          SPI_MCP2510_reg_write ( unsigned char addr, unsigned char byte );

// Bitmanipulation in einem Register des CAN-Controllers
void SPI_MCP2510_reg_bit_modify     ( unsigned char addr, unsigned char mask,
                                      unsigned char byte);
#endif   /* SPI_MCP2515_H */
